using System;
using System.Collections.Generic;
using System.Text;

namespace Colman.Rpg.Messaging
{
    /// <summary>
    /// Represents a base request to equip an item from the inventory instead
    /// of an item that is currently equipped.
    /// </summary>
    [Serializable]
    public abstract class EquipItemRequest<T> : RequestMessage where T : Item
    {
        /// <summary>
        /// Creates a new instance of <see cref="EquipItemRequest&lt;T&gt;" />.
        /// </summary>
        /// <param name="item">Represents the item to equip.</param>
        [System.Diagnostics.DebuggerStepThrough]
        public EquipItemRequest(T item)
        {
            this.item = item;
        }

        #region T Item { get; } (item)
        private T item;

        /// <summary>
        /// Gets the item to equip.
        /// </summary>
        [System.ComponentModel.Description("Indicates the item to equip.")]
        public T Item
        {
            [System.Diagnostics.DebuggerStepThrough]
            get
            {
                return this.item;
            }
        }
        #endregion
    }

    /// <summary>
    /// Represents a request to equip an armor from the inventory instead
    /// of the armor that is currently equipped.
    /// </summary>
    [Serializable]
    public class EquipArmorRequest : EquipItemRequest<Armor>
    {
        /// <summary>
        /// Creates a new instance of <see cref="EquipArmorRequest" />.
        /// </summary>
        /// <param name="armor">Represents the armor to equip.</param>
        [System.Diagnostics.DebuggerStepThrough]
        public EquipArmorRequest(Armor armor)
            : base(armor)
        {
        }
    }

    /// <summary>
    /// Represents a request to equip a weapon from the inventory instead
    /// of the weapon that is currently equipped.
    /// </summary>
    [Serializable]
    public class EquipWeaponRequest : EquipItemRequest<Weapon>
    {
        /// <summary>
        /// Creates a new instance of <see cref="EquipWeaponRequest" />.
        /// </summary>
        /// <param name="weapon">Represents the weapon to equip.</param>
        [System.Diagnostics.DebuggerStepThrough]
        public EquipWeaponRequest(Weapon weapon)
            : base(weapon)
        {
        }
    }
}
